from typing import List

class Settings:
    """应用配置"""
    
    # API配置
    API_PREFIX: str = "/api/v1"
    
    # 服务器配置
    SERVER_HOST: str = "127.0.0.1"
    SERVER_PORT: int = 8000
    
    # CORS配置 - 更宽松的配置
    CORS_ORIGINS: List[str] = [
        "http://localhost:3000",
        "http://localhost:8080", 
        "http://localhost:8081",
        "http://localhost:8085",
        "http://127.0.0.1:3000",
        "http://127.0.0.1:8080",
        "http://127.0.0.1:8081",
        "http://127.0.0.1:8085",
        "http://localhost:*",  # 允许所有localhost端口
        "http://127.0.0.1:*",  # 允许所有127.0.0.1端口
        "*"  # 开发环境允许所有源
    ]
    
    # 数据库配置
    DATABASE_URL: str = "mysql+pymysql://root:root@localhost:3306/lf_forecast?charset=utf8mb4"
    
    # 应用配置
    APP_NAME: str = "电力负荷预测系统"
    APP_VERSION: str = "1.0.0"
    DEBUG: bool = True

# 创建设置实例
settings = Settings() 